﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="pgTdr.aspx.cs" Inherits="EGuayas.Web.Auditoria.Promo.Cumplimiento.tabs.pgTdr" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title><link  href="~/Resources/css/Style.css"  rel="stylesheet" />
    <!-- Load Ext JS --> 
    <script src="../../../../Resources/js/Global.js"></script>           
</head>
<body>  
    <form id="Form1" runat="server">     
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <ext:Viewport ID="Viewport1" runat="server" Layout="BorderLayout">
    <Items>
        <ext:FormPanel ID="FormPanel1" runat="server" Region="Center" Layout="VBoxLayout">
                    <LayoutConfig>
                            <ext:VBoxLayoutConfig Align="Stretch" />
                    </LayoutConfig>
             <TopBar> 
                  <ext:Toolbar ID="Toolbar1" runat="server">
                                <Items> 
                                     <ext:ToolbarFill />
                                    <ext:Button ID="ShowTab1" runat="server" Text="Mostrar Documentos" Disabled="true" Icon="PageWhiteStack">
                                        <Listeners>
                                            <Click Handler="#{TabPanel1}.addTab(#{Tab1},0);this.setDisabled(true);" />
                                        </Listeners>
                                    </ext:Button>
                                   <ext:Button ID="ShowTab2" runat="server" Text="Mostrar Informe"  Icon="PagePaste">
                                        <Listeners>
                                            <Click Handler="#{TabPanel1}.addTab(#{Tab2},1);this.setDisabled(true);" />
                                        </Listeners>
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
             </TopBar>
                    <Items>
                      
                              <ext:TabPanel ID="TabPanel1" runat="server" Flex="1"  TabPosition="Left">
                                <Items>
                                 <%--
                                   Documentación sobre terminos de referencia   
                                 --%> 
                                 <ext:Panel ID="Tab1"  Title="Documentos" runat="server" Layout="Fit" Icon="PageWhiteStack" Closable="true" CloseAction="Hide" >
                                        <Items>
                                            <%--::Archivos Promotor--%> 
                                            <ext:UserControlLoader ID="wuc_load_A003" UserControlID="wuc_loaddoc_tdr_003"  runat="server" Path="~/Auditoria/promotor/wucLoadDoc.ascx" OnComponentAdded="OnLoadDocTdrAdded" />                                                     
                                        </Items>
                                        <Listeners>
                                            <Close Handler="#{ShowTab1}.setDisabled(false);" />
                                        </Listeners>
                                 </ext:Panel>
                                 <%--::   --%> 
                                 <ext:Panel ID="Tab2" Title="Informe" runat="server" Closable="true" CloseAction="Hide"  Icon="PagePaste" Layout="Fit">
                                        <Items> 
                                             <ext:UserControlLoader ID="uc_correginfodoc_h001" UserControlID="wuc_correginfodoc_bor_h01" runat="server" Path="~/Auditoria/promotor/wucInformeCorrecion.ascx" OnComponentAdded="OnInformeAdded" />                                      
                                        </Items>
                                    <Listeners>
                                        <Close Handler="#{ShowTab2}.setDisabled(false);" />
                                    </Listeners>
                                </ext:Panel>
                               </Items>
                               <Bin></Bin>                       
                        </ext:TabPanel>
                       
                   </Items>
                   <BottomBar>
                     <ext:StatusBar 
                            ID="StatusBar2" 
                            runat="server"
                            StatusAlign="Left">
                            <Items>                                
                                <ext:ToolbarTextItem ID="ToolbarTextItem1" runat="server" Text="" Cls="ux-bold-text-item"  Margin="15"/>
                            </Items>
                        </ext:StatusBar>
                    </BottomBar>
       </ext:FormPanel>
       <%--::   
       <ext:Window 
            ID="winVisor" 
            runat="server"            
            Icon="Zoom"
            Height="185" 
            Width="350"
            ButtonAlign="Center"
            BodyStyle="background-color: #fff;" 
            BodyPadding="5"            
            hidden="true" 
            closeaction="Hide">
            <Content>
                <ext:FormPanel 
                    ID="FormPanel5" 
                    Border="false"
                    runat="server"
                    Width="330"            
                    BodyPadding="5"
                    Layout="Form">
                    <FieldDefaults LabelWidth="75" LabelPad="20" LabelSeparator="" />
                    <Items>   </Items>
                    <Listeners>
                        <ValidityChange Handler="#{btnWinComentariOk}.setDisabled(!valid);" />
                    </Listeners>
                </ext:FormPanel>
            </Content>
            <Buttons>
                  <ext:Button ID="Button5" runat="server" Text="Aceptar"  OnClientClick="AppGlobalJs.closeWin(#{winVisor})">
                    <Listeners>                     
                    </Listeners>
                </ext:Button>
            </Buttons>
            <Listeners>
                <BeforeHide Handler="#{forPanelComentario}.getForm().reset();"></BeforeHide>              
            </Listeners>
        </ext:Window>
       <ext:Window 
            ID="winDocumento" 
            runat="server"            
            Icon="Attach"
            Height="200" 
            Width="350"
            ButtonAlign="Center"
            BodyStyle="background-color: #fff;" 
            BodyPadding="5"            
            hidden="true" 
            closeaction="Hide">
            <Content>
                <ext:FormPanel 
                    ID="FormPanel4" 
                    Border="false"
                    runat="server"
                    Width="330"            
                    BodyPadding="5"
                    Layout="Form">
                     <Defaults>
                <ext:Parameter Name="anchor" Value="95%" Mode="Value" />
                <ext:Parameter Name="allowBlank" Value="false" Mode="Raw" />
                <ext:Parameter Name="msgTarget" Value="side" Mode="Value" />
            </Defaults>
            <Items>
                <ext:TextField ID="TextField1" runat="server" FieldLabel="Nombre" />
                <ext:FileUploadField 
                    ID="FileUploadField2" 
                    runat="server" 
                    EmptyText="Seleccione documento"
                    FieldLabel="Documento"
                    ButtonText=""
                    Icon="ImageAdd"
                    />
                <ext:TextArea ID="TextArea2" runat="server" FieldLabel="Descripción" />
                </Items>
                    <Listeners>
                        <ValidityChange Handler="#{btnWinDocOk}.setDisabled(!valid);" />
                    </Listeners>
                </ext:FormPanel>
            </Content>
            <Buttons>
                  <ext:Button ID="Button2" runat="server" Text="Aceptar" Disabled="true">
                    <DirectEvents>
                        <Click 
                            OnEvent="UploadClick"
                            Before="if (!#{forPanelDoc}.getForm().isValid()) { return false; } 
                                Ext.Msg.wait('Uploading your photo...', 'Uploading');"
                                
                            Failure="Ext.Msg.show({ 
                                title   : 'Error', 
                                msg     : 'Error during uploading', 
                                minWidth: 200, 
                                modal   : true, 
                                icon    : Ext.Msg.ERROR, 
                                buttons : Ext.Msg.OK 
                            });">
                               <EventMask ShowMask="True"></EventMask>
                        </Click>
                    </DirectEvents>
                </ext:Button>
                  <ext:Button ID="Button3" runat="server" Text="Aceptar"  OnClientClick="AppGlobalJs.closeWin(#{winDocumento})">
                    <Listeners>                     
                    </Listeners>
                </ext:Button>
            </Buttons>
            <Listeners>
                <BeforeHide Handler="#{forPanelDoc}.getForm().reset();"></BeforeHide>              
            </Listeners>
        </ext:Window>
        
       
       <ext:Window 
            ID="winAddInforme" 
            runat="server"            
            Icon="ReportEdit"
            Height="200" 
            Width="350"
            ButtonAlign="Center"
            BodyStyle="background-color: #fff;" 
            BodyPadding="5"            
            hidden="true" 
            closeaction="Hide">
            <Content>
                <ext:FormPanel 
                    ID="forPanelDoc" 
                    Border="false"
                    runat="server"
                    Width="330"            
                    BodyPadding="5"
                    Layout="Form">
                     <Defaults>
                <ext:Parameter Name="anchor" Value="95%" Mode="Value" />
                <ext:Parameter Name="allowBlank" Value="false" Mode="Raw" />
                <ext:Parameter Name="msgTarget" Value="side" Mode="Value" />
            </Defaults>
            <Items>
                <ext:TextField ID="PhotoName" runat="server" FieldLabel="Nombre" />
                <ext:FileUploadField 
                    ID="FileUploadField1" 
                    runat="server" 
                    EmptyText="Seleccione documento"
                    FieldLabel="Documento"
                    ButtonText=""
                    Icon="ImageAdd"
                    />
                <ext:TextArea ID="TextArea1" runat="server" FieldLabel="Descripción" />
                </Items>
                    <Listeners>
                        <ValidityChange Handler="#{btnWinDocOk}.setDisabled(!valid);" />
                    </Listeners>
                </ext:FormPanel>
            </Content>
            <Buttons>
                  <ext:Button ID="btnWinDocOk" runat="server" Text="Aceptar" Disabled="true">
                    <DirectEvents>
                        <Click 
                            OnEvent="UploadClick"
                            Before="if (!#{forPanelDoc}.getForm().isValid()) { return false; } 
                                Ext.Msg.wait('Uploading your photo...', 'Uploading');"
                                
                            Failure="Ext.Msg.show({ 
                                title   : 'Error', 
                                msg     : 'Error during uploading', 
                                minWidth: 200, 
                                modal   : true, 
                                icon    : Ext.Msg.ERROR, 
                                buttons : Ext.Msg.OK 
                            });">
                            <EventMask ShowMask="True"></EventMask>
                        </Click>
                    </DirectEvents>
                </ext:Button>
                  <ext:Button ID="btnWinClose" runat="server" Text="Aceptar"  OnClientClick="AppGlobalJs.closeWin(#{winAddInforme})">
                    <Listeners>                     
                    </Listeners>
                </ext:Button>
            </Buttons>
            <Listeners>
                <BeforeHide Handler="#{forPanelDoc}.getForm().reset();"></BeforeHide>              
            </Listeners>
        </ext:Window>
        --%> 
      </Items>
   </ext:Viewport>
    <ext:XScript ID="XScript1" runat="server">
    <script type="text/javascript">
        var pgFn = new Object();
        pgFn.presentaMensaje=true;

        pgFn.Test = function() {
            alert("OK");
        };
        AppGlobalJs.showWin = function (objwin) {
            objwin.show();
        };
        AppGlobalJs.closeWin = function(objwin) {
            objwin.hide();
        };
        pgFn.menuItemClick = function (menu, item) {
            App.PnlCenter.body.update(Ext.String.format("Clicked: {0}", item.text)).highlight();
        };
 </script>
</ext:XScript>
 </form>     
</body>


</html>
